package com.wfy;

import com.wfy.common.listener.InstantiationTracingBeanPostProcessor;
import com.wfy.common.listener.WebContextListener;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@ServletComponentScan(basePackages = {"com.wfy.common.filter"})
@EnableTransactionManagement
public class SpringbootprojectApplication {

    private static final Logger LOGGER = LoggerFactory.getLogger(SpringbootprojectApplication.class);

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(SpringbootprojectApplication.class);

        // 添加bean加载完之后执行的监听器
        springApplication.addListeners(new WebContextListener());
        springApplication.addListeners(new InstantiationTracingBeanPostProcessor());

        springApplication.run(args);
        LOGGER.info("spring boot is starting...");
    }

}
